import java.util.*;

public class Demo2 {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        String str = scan.next();
        int[] array = new int[n+2];

        for(int i = 1; i <= n; i++) {
            array[i] = i;
        }


        int redex = 1;
        boolean fly = false;
        if(n <= 4) {
            for(int i = 0; i < str.length(); i++) {
                char ch = str.charAt(i);
                if(ch == 'U') {
                    redex-- ;
                    if(array[redex] == 0) {
                        redex = n;
                        fly = true;
                    }

                }else {
                    if(ch == 'D') {
                        redex++;
                        if(array[redex] == 0) {
                            redex = 1;
                            fly = true;
                        }
                    }
                }
            }
        }else {
            for(int i = 0; i < str.length(); i++) {
                char ch = str.charAt(i);
                if(ch == 'U') {
                    redex-- ;
                    if(array[redex] == 0) {
                        redex = n;
                        fly = true;
                    }

                }else {
                    if(ch == 'D') {
                        redex++;
                        if(array[redex] == 0) {
                            redex = 1;
                            fly = false;
                        }
                    }
                }
            }
        }

        if(fly) {
            for (int i = redex - 3; i <= redex; i++) {
                System.out.println(array[i]);
            }
        }else {
            for (int i = redex; i <= redex +3; i++) {
                System.out.println(array[i]);
            }
        }
    }
}
